package com.bgds.sys.module.entity.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author lijiacheng
 * @description: TopAndLowDto
 * @date 2021/11/25 9:34
 * @company: 中冶赛迪重庆信息技术有限公司
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TopAndLowDto {

    private Float topLimit;

    private Float lowLimit;

    /**
     * 是否两个值都有
     */
    public boolean isAvailable() {
        return null != topLimit && null != lowLimit;
    }

    /**
     * 是否存在只有一个值的
     */
    public boolean ifSingleValueExist() {
        boolean cond1 = null != topLimit && null == lowLimit;
        boolean cond2 = null == topLimit && null != lowLimit;
            return cond1||cond2;
    }
}
